home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / hard / hack / MMKeyboard.lha / MMKeyboard / developer / example / ScreenNextCommand.asm
Assembly Source File  |  2002-09-12  |  1KB  |  69 lines

  1.  
  2.     include "src.myinclude"
  3.     output t:ScreenNext.Command
  4.         
  5. ;--------------------------------------------------------------------
  6. External_VersionNumber    = 0
  7. External_IDData    = "EXCO"
  8. External_HeaderData    = $70004E75 ;moveq #0,d0 / rts
  9.  
  10.     RSRESET
  11. External_Header    rs.l 1
  12. External_Node    rs.b (LN_SIZE-4)
  13. External_Name    rs.l 1
  14. External_ID    rs.l 1
  15. External_Version    rs.l 1
  16. External_Code    rs.l 1
  17. External_Template    rs.l 1
  18. External_Reserved    rs.l 1
  19.  
  20.  
  21. ;--------------------------------------------------------------------
  22.     moveq    #0,d0
  23.     rts
  24.     ds.b    LN_SIZE-4
  25.     dc.l    Command_Name
  26.     dc.l    External_IDData
  27.     dc.l    External_VersionNumber
  28.     dc.l    Command_ScreenNext
  29.     dc.l    0 ;Command_Template
  30.     dc.l    0 ;Reserved
  31.  
  32.  
  33. Command_Name    dc.b "ScreenNext",0
  34. ;Command_Template    dc.b "Argument/S",0
  35. T_Intuition    dc.b "intuition.library",0
  36.     even
  37.     
  38. ;--------------------------------------------------------------------
  39. ;    >a0.l Pointer on Arguments
  40. ;--------------------------------------------------------------------
  41. Command_ScreenNext    movem.l    d4/a5-a6,-(a7)
  42.     lea    T_Intuition(pc),a1
  43.     moveq    #0,d0
  44.     move.l    4.w,a6
  45.     JSRLIB    OpenLibrary
  46.     move.l    d0,d0
  47.     beq    .Done
  48.     move.l    d0,a5
  49.  
  50.     JSRLIB    Forbid
  51.     exg.l    a5,a6
  52.     moveq    #0,d0
  53.     JSRLIB    LockIBase
  54. ;---
  55.     move.l    ib_FirstScreen(a6),d4
  56.     move.l    d0,a0
  57.     JSRLIB    UnlockIBase
  58.     move.l    d4,d0
  59.     beq    .NoScreenToBack
  60.     move.l    d4,a0
  61.     JSRLIB    ScreenToBack
  62. .NoScreenToBack    exg.l    a5,a6
  63.     JSRLIB    Permit
  64.     move.l    a5,a1
  65.     JSRLIB    CloseLibrary
  66. .Done    movem.l    (a7)+,d4/a5-a6
  67.     rts
  68.     
  69.